<?php

namespace app\home\controller;

use app\home\model\Member;
use think\Cache;
use think\Controller;
use think\Request;

class Base extends Controller{


	protected $member;


	public function __construct (Request $request = null) {
		parent::__construct($request);

		$token = $this->request->header('token');

		$user = Cache::get($token);
		if(!$user){
			return error('请先登录');
		}

		$memberModel = new Member();
		$this->member = $memberModel->where('id',$user['member_id'])->find();

	}

}
